package chatclient;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import javax.swing.SwingConstants;

public class About extends JDialog {

	private final JPanel contentPanel = new JPanel();

	/**
	 * Launch the application.
	 * 
	 */

	public static void showDialog(JFrame owner) {
		About dialog = new About(owner);
		dialog.setVisible(true);
		// return dialog.getValue();
	}

	/*
	 * public static void main(String[] args) { try { About dialog = new
	 * About(); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
	 * dialog.setVisible(true); } catch (Exception e) { e.printStackTrace(); } }
	 */
	/**
	 * Create the dialog.
	 */
	public About(JFrame owner) {
		setTitle("\u041E \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0435");
		setResizable(false);
		setBounds(100, 100, 450, 257);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		{
			JLabel label = new JLabel(
					"\u041C\u043D\u043E\u0433\u043E\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u0447\u0430\u0442");
			label.setHorizontalAlignment(SwingConstants.CENTER);
			label.setBounds(99, 30, 250, 16);
			Font font = new Font("Times Roman", Font.BOLD, 14);
			label.setFont(font);
			contentPanel.add(label);
		}
		{
			JLabel lblNewLabel = new JLabel(
					"\u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u043E \u0441\u0442\u0443\u0434\u0435\u043D\u0442\u043E\u043C \u0433\u0440\u0443\u043F\u043F\u044B \u0410\u041C-709\u0441");
			lblNewLabel.setBounds(12, 118, 256, 16);
			contentPanel.add(lblNewLabel);
			lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		}

		JLabel label = new JLabel(
				"\u0411\u0435\u0437\u0437\u0443\u0431\u043E\u0432\u044B\u043C \u041C\u0430\u043A\u0441\u0438\u043C\u043E\u043C \u0421\u0435\u0440\u0433\u0435\u0435\u0432\u0438\u0447\u0435\u043C");
		label.setHorizontalAlignment(SwingConstants.CENTER);
		label.setBounds(22, 148, 220, 26);
		contentPanel.add(label);
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton okButton = new JButton("OK");
				okButton.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						setVisible(false);
					}
				});
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
		}
	}
}
